#include<bits/stdc++.h>
#define int long long
using namespace std;

const int N = 1e5 + 10;
int h[N], e[N], ne[N], idx;

void add(int a, int b) {
	e[idx] = b;
	ne[idx] = h[a];
	h[a] = idx ++ ;
}
map<int, set<int>>mp;

int ret = 0;
int ling = 0;
int v[N];
set<int>se;
int g;
vector<int> ret2;

void dfs(int dian) {
		ret2.push_back(dian);
		for(int i : mp[dian]) {
			dfs(i);
		}
}

signed main() {
	int n;
//	memset(h, -1, sizeof h);
	cin >> n;
	for(int i = 1; i <= n; ++ i ) {
		int x;
		cin >> x;
//		cout << "x = " << x << endl;
		if(x == 0) {
			g = i;
		}
		mp[x].insert(i);
	}
	for(int i = 1; i <= n; ++ i ) {
		int p = mp[i].size();
		ret = max(ret,p);
		if(p != 0)se.insert(p);
	} 
	cout << ret << " ";
	if(se.size() == 1) {
		cout << "yes" << endl;
	} else {
		cout << "no" << endl;
	}
	dfs(g);
	for(int i = 0; i < ret2.size(); ++ i ) {
		if(i == 0) {
			cout << ret2[i];
		}
		else cout << ' ' << ret2[i];
	}
	return 0;
}

